# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=jd-cli
pkgver=1.2.0
pkgrel=1
groups=('blackarch' 'blackarch-decompiler' 'blackarch-reversing')
pkgdesc='Command line Java Decompiler.'
arch=('any')
url='https://github.com/kwart/jd-cli'
license=('GPL3')
depends=('java-environment')
options=('!strip')
source=("https://github.com/kwart/jd-cli/releases/download/$pkgname-$pkgver/$pkgname-$pkgver-dist.tar.gz")
sha512sums=('46e618fdb8bde363cdb8caedce38b18d14306b476a1ffed333f5073f193184222775cee4c2e4fc099580818984554c3df73c8f7935dcb25074c74ef813b9c586')

package() {
  install -dm 755 "$pkgdir/usr/bin"

  install -Dm 644 "$pkgname.jar" \
    "$pkgdir/usr/share/$pkgname/$pkgname.jar"

  cat > "$pkgdir/usr/bin/$pkgname" << EOF
#!/bin/sh
exec java -jar /usr/share/$pkgname/$pkgname.jar "\$@"
EOF

  chmod +x "$pkgdir/usr/bin/$pkgname"
}

